<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>
<body>
<!-- Yii 利用Clip构建layout http://hudeyong926.iteye.com/blog/1672518#bc2299095 -->
<div class="container" id="page">
	<!--<div id="header">
		<div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
	</div>--><!-- header -->
	<div id="mainmenu">
		<?php 
		// 显示功能菜单
		$this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'主页', 'url'=>array('/index/index')),// 'label'=>'Home'标签 名称  /site/index动作
				//array('label'=>'关于我们', 'url'=>array('/site/page', 'view'=>'about')),
				//array('label'=>'联系我们', 'url'=>array('/site/contact')),
                array('label'=>'分类', 'url'=>array('/category/list')),
				array('label'=>'登录', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				array('label'=>'退出 ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest)
			),
		)); ?>
	</div><!-- mainmenu -->
	
	<?php if(isset($this->breadcrumbs)):?>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?><!-- breadcrumbs -->
	<?php endif?>
	<div id="body" style="background:white url(bg.gif) repeat-x left top;">
	<?php 
	// 登录了系统,显示操作菜单
	if(!Yii::app()->user->isGuest) {
//http://www.yincart.com/docs
    ?>	
	<?php $this->beginClip('lmeun'); ?>	
	<div id="smeun" style="width:200px;float:left;padding:10px;">
	  <span>系统管理</span>
	  <ul style="list-style:none;">	    
	    <li><?php echo CHtml::link('基本设置',Yii::app()->createUrl('setting'));?></li>
	    <li><?php echo CHtml::link('菜单管理',Yii::app()->createUrl('meun'));?></li>
	    <li><?php echo CHtml::link('权限管理',Yii::app()->createUrl('srbac')); ?></li>
	  </ul>
	  <span>用户管理</span>
	  <ul style="list-style:none;">	    
	    <li><?php echo CHtml::link('会员管理',Yii::app()->createUrl('user/index')); ?></li>
	    <li><?php echo CHtml::link('管理员设置',Yii::app()->createUrl('user/admin')); ?></li>
	  </ul>	 
	  <span>数据库管理</span>
	  <ul style="list-style:none;">	    
	    <li><?php echo CHtml::link('基本配置',Yii::app()->createUrl('mysqladmin/setting')); ?></li>
	  </ul>	  
	</div>
    <?php $this->endClip(); ?>
    <?php }?>
	<?php echo $this->clips['lmeun']; ?>
	<div id="mainbody" style="width:100%;float:right;position:absolute;display:;">
	<?php echo $content; ?>
	</div>
	
	</div>
	<div class="clear"></div>	
	<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
		All Rights Reserved.<br/>
		<?php echo Yii::powered();?>
	</div><!-- footer -->	
</div><!-- page -->
</body>
</html>
